package com.ruoyi.payment.controller;

import com.ruoyi.payment.mapper.TbFloorMapper;
import com.ruoyi.payment.mapper.TbRoomMapper;
import com.ruoyi.payment.mapper.TbUnitMapper;
import com.ruoyi.payment.service.TbBuildingblockService;
import com.ruoyi.pojo.TbBuildingblock;
import com.ruoyi.pojo.TbFloor;
import com.ruoyi.pojo.TbRoom;
import com.ruoyi.pojo.TbUnit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("buildingblock")
public class TbBuildingblockController {

    @Autowired
    private TbBuildingblockService tbBuildingblockService;
    //    单元mapper
    @Autowired
    private TbUnitMapper tbUnitMapper;
    //    楼层mapper
    @Autowired
    private TbFloorMapper tbFloorMapper;
    //  房号mapper
    @Autowired
    private TbRoomMapper tbRoomMapper;


    @GetMapping("findAll")
    public List<TbBuildingblock> findAll() {
        return tbBuildingblockService.list();
    }

    //单元
    @GetMapping("findUnit")
    public List<TbUnit> findUnit() {
        return tbUnitMapper.selectList(null);
    }

    //楼层
    @GetMapping("findFloor")
    public List<TbFloor> findFloor() {
        return tbFloorMapper.selectList(null);
    }

    //    房号
    @GetMapping("findRoom")
    public List<TbRoom> findRoom() {
        return tbRoomMapper.selectList(null);
    }


}
